package com.baosight.scaq.aq.ci.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.threadlocal.UserSession;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.scaq.aq.ci.domain.AQCIGasInfoNew;

public class ServiceAQCI44 extends ServiceEPBase {
	@Override
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的
		inInfo.addBlock(getMines());
		return inInfo;
	}
	
	
	/**
	 * 矿井block
	 * @return
	 */
	private EiBlock getMines() {
		// TODO Auto-generated method stub
		EiBlock block = new EiBlock("cmes.ch.mine");

		EiColumn EiColumn = new EiColumn("display");
		EiColumn.setType("C");
		block.addMeta(EiColumn);

		EiColumn = new EiColumn("value");
		EiColumn.setType("C");
		block.addMeta(EiColumn);

		List<Map> _list = new ArrayList<Map>();
		Map<String, String> _map = new HashMap<String, String>();
		_map.put("value", "");
		_map.put("display", "");
		_list.add(_map);
		
		_map = new HashMap<String, String>();
		_map.put("value", "重庆松藻煤电有限责任公司/松藻煤矿");
		_map.put("display", "松藻煤矿");
		_list.add(_map);
		
		_map = new HashMap<String, String>();
		_map.put("value", "重庆松藻煤电有限责任公司/打通一矿");
		_map.put("display", "打通一矿");
		_list.add(_map);
		
		_map = new HashMap<String, String>();
		_map.put("value", "重庆松藻煤电有限责任公司/渝阳煤矿");
		_map.put("display", "渝阳煤矿");
		_list.add(_map);
		
		_map = new HashMap<String, String>();
		_map.put("value", "重庆松藻煤电有限责任公司/石壕煤矿");
		_map.put("display", "石壕煤矿");
		_list.add(_map);
		
		_map = new HashMap<String, String>();
		_map.put("value", "重庆松藻煤电有限责任公司/逢春煤矿");
		_map.put("display", "逢春煤矿");
		_list.add(_map);

//		List<Map> _listData = new ArrayList<Map>();
//		try {
//			_listData = dao.query("AQCIGasInfoNew.queryTreeChild", null);
//		} catch (Exception e) {}
//		
//		for(int i = 0; i < _listData.size(); i++) {
//			_list.add(_listData.get(i)); 
//		} 
		block.setRows(_list);
		return block;
	}
	
}
